<script setup lang="ts">
import {defineExpose, ref} from 'vue'

const form = ref({
  innerNet:"", // 内网地址
  interNet:"", // 互联网地址
  netLv:"inter", // 网络优先级
  uniqueType:"", // 唯一码生成方式
  uniqueValue:"", // 当前唯一码
  deviceId:"", // 设备ID
  httpEcho:60, // http 心跳间隔
  openTcp:false, // 是否需要开启tcp长连接
})

const dialogVisible = ref(false)

const handleClose = () => {

}

defineExpose({
  dialogVisible,
  form
})

</script>

<template>
  <el-dialog
    v-model="dialogVisible"
    title="IDP 配置信息"
    width="500"
    :before-close="handleClose"
  >
    <el-form :model="form" label-width="auto" style="max-width: 600px">
      <el-form-item label="企业网地址">
        <el-input v-model="form.innerNet" />
      </el-form-item>
      <el-form-item label="互联网地址">
        <el-input v-model="form.interNet" />
      </el-form-item>
      <el-form-item label="网络优先级">
        <el-radio-group v-model="form.netLv">
          <el-radio value="inner">企业网</el-radio>
          <el-radio value="inter">互联网</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="唯一码规则">
        <el-radio-group v-model="form.uniqueType">
          <el-radio value="bios+disk">bios+disk</el-radio>
          <el-radio value="uuid">uuid</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="心跳间隔">
        <el-input-number v-model="form.httpEcho" :min="1" :max="60">
          <template #suffix>
            <span>分钟</span>
          </template>
        </el-input-number>
      </el-form-item>
      <el-form-item label="双向通讯">
        <el-radio-group v-model="form.openTcp">
          <el-radio value="true">开启</el-radio>
          <el-radio value="false">关闭</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item>
        <el-button @click="dialogVisible = false">Cancel</el-button>
        <el-button>Confirm</el-button>
      </el-form-item>
    </el-form>
  </el-dialog>
</template>

<style scoped lang="scss">

</style>
